* FILE NAME : PRESAV.PRG
*
         sele 1
         SET EXCLU OFF
*         USE &DR&F1 index &DR&F12,&dr&f1,&DR&F13,&DR&F11
         USE &DR&F1 index &DR&F12,&dr&f1,&dr&f13
         GOTO rec
         IF REC_LOCK(0)
            REPL PAT_NAME WITH PNAME,PAT_F_NAME WITH PFNAME,PAT_M_INIT WITH MINIT,PAT_SEX WITH PATSEX
            REPL PAT_DOB WITH PATDOB,PAT_NATIO WITH PATNAT,BLOOD_GRP WITH BLOODG,BLOOD_RHE WITH BLOODR
** 16/06/2000 - Dickson - start
            REPL PAT_MARITA WITH MARITAL, PAT_KIDS WITH KIDS_IND
            REPL PAT_REFER WITH U_PAT_REFER
** 16/02/2000 - Dickson - end

            REPL HOM_ADD  WITH HOMADD,HOM_CITY WITH HOMCITY,HOM_COUNT WITH HOMCOUNT,HOM_TEL  WITH HOMTEL
** Buu Email address in patient file 24/6/03
		REPL EMAIL WITH E_MAIL
**		REPL ARCH_C WITH ARCH_CL
**		REPL ARCH_D WITH ARCH_DT
** Buu Email end
            REPL LOC_ADD1 WITH LOCAPTNO+LOCADD1,LOC_ADD2 WITH LOCADD2,LOC_CITY WITH LOCCITY,LOC_TEL WITH LOCTEL
** Buu 18/08/1999
*            REPL JOB_POSIT WITH JOBPOSIT,JOB_CRPCOD WITH COMCOD,JOB_CORP WITH CONAM,JOB_ADD1 WITH JOBADD1
            REPL JOB_POSIT WITH JOBPOSIT,JOB_CRPCOD WITH COCOD,JOB_CORP WITH CONAM,JOB_ADD1 WITH JOBADD1
** End Buu 18/08/1999
            REPL JOB_ADD2 WITH JOBADD2,JOB_CITY WITH JOBCITY,JOB_FAX WITH JOBFAX,JOB_TEL1 WITH JOBTEL1,JOB_TEL2 WITH JOBTEL2
            REPL JOB_TEL3 WITH JOBTEL3,JOB_TELEX WITH JOBTELEX,JOB_PERMGR WITH JOBPERMGR,JOB_FINMGR WITH JOBFINMGR,PAT_CODCRP WITH COCOD
            REPL AEA_MEMBER WITH AEAM,AEA_PROGR WITH nmem,AEA_ENDATE WITH memval
            IF CMEM = 'CP'
               REPL HEALTHLINE WITH .T.
               REPL HL_END WITH MEMVAL
            ENDIF
            IF PER .OR. DOC
               REPL AEASOS_PER WITH .T.
            ELSE
               REPL AEASOS_PER WITH .F.
            ENDIF
            IF FAM
               REPL AEASOS_FAM WITH .T.,FAM_RELPER WITH FAMRELPER,FAM_PERCOD WITH FAMPERCOD
            ELSE
               REPL AEASOS_FAM WITH .F.
            ENDIF
            repl pat_filcod with kodepat,PAT_CODDAT WITH CODDAT,PAT_CODCRE WITH CODCRE,PAT_CODTYP WITH CODTYP,PAT_CODCRP WITH COCOD
            REPL DAT_CRFILE WITH DATFIL,ENTRY_DAT WITH ENTDAT,REL_FILCOD WITH RELCOD
            IF P10=1
               REPL PAT_CMS WITH .T.
            ENDIF
         ENDIF
         UNLOCK
